﻿package domino 
{
	import Box2D.Collision.b2ContactPoint;
	import Box2D.Dynamics.b2Body;
	import Box2D.Dynamics.b2ContactListener;
	/**
	 * ...
	 * @author sergiy
	 */
	public class DominContactListener extends b2ContactListener
	{
		
		public function DominContactListener() 
		{
			
		}
		override public function Add(point:b2ContactPoint):void
		{

			if (point.shape1.GetBody().GetUserData() is actorCoin)
			   point.shape1.GetBody().GetUserData().takeMe();

			if (point.shape2.GetBody().GetUserData() is actorCoin)
			  point.shape2.GetBody().GetUserData().takeMe();
			   

			super.Add(point);

		}
	}

}